﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Weazel.Willows.Model
{	
	public partial class SignalWriterInterface
		: ChannelWriterInterface, ISignal
	{
		private ISignal attachedSignal;
		public ISignal AttachedSignal
		{
			get { return attachedSignal; }
			set { attachedSignal = value; }
		}

		public override bool HasAttachedChannel
		{
			get { return attachedSignal != null; }
		}

		public override bool HasAttachedWriter
		{
			get { throw new NotImplementedException(); }
		}

		public override List<Module> GetReadingDatapaths()
		{
			throw new NotImplementedException();
		}

		public void SetWritingDatapath(Module module)
		{
		}



		public SignalWriterInterface(Module parent, Signal signal, string uniqueName)
			: base(parent, signal.TypeRegistry, signal.Type, signal.LocalName, uniqueName)
		{
			attachedSignal = signal;
			signal.BindInput(this);
		}

		public SignalWriterInterface(Module parent, SignalOutConnector connector, string uniqueName)
			: base(parent, connector.TypeRegistry, connector.Type, connector.LocalName, connector.UniqueName)
		{
			attachedSignal = connector;
			connector.BindInput(this);
		}

		public SignalWriterInterface(Module parent, TypeRegistry typeRegistry, Type type, string name, string uniqueName)
			: base(parent, typeRegistry, type, name, uniqueName)
		{
		}
	}
}
